<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="robots" content="noindex,nofollow" />
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/common.css" media="all">
	</head>

	<body class="page-body">
		
		<div class="tpcms-body-div page-main">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			    <legend>审核报价</legend>
			  </fieldset>
			   
			  <div class="layui-row">
			    <div class="layui-col-xs12">
			      <button type="button" class="layui-btn pass">审核通过</button>
				  <button type="button" class="layui-btn layui-btn-danger reject">审核驳回</button>
			    </div>
				<br/>
				<br/>
				<br/>
				<div style="font-size: 16px;">
					<div class="layui-col-xs6">
					  <div class="grid-demo grid-demo-bg1">订单信息</div>
					</div>
					<div class="layui-col-xs6">
					  <div class="grid-demo">订单号：{$info.s_order}</div>
					</div>
					<hr>
					<p>上门时间：{$info.visit_time}</p><br/>
					<p>装修面积：{$info.mianji}平米</p><br/>
					<p>房屋户型：{$info.huxing}</p><br/>
					<p>设计报价：{$info.money}万元</p><br/>
					<p>服务项目：{$info.staff_type_name}</p><br/>
					<p>订单备注：{$info.reason}</p><br/>
					<p>报价详情:<br/><img src="{$info.info}" width="80%"></p><br/>
				</div>
			  </div> 
			

			<script src="__PUBLIC__/layui/layui.js"></script>
			<script src="__PUBLIC__/jquery/jquery.min.js"></script>

			<script>
				function send_ajax(url,data){
					$.ajax({
						url: url,
						type: 'post',
						data:data,
						dataType: 'json',
						success: function (res) {
							layer.closeAll();
							if (res.code == 0) {
								layer.msg(res.message, {
									offset: '15px',
									icon: 1,
									time: 1000
								}, function() {
									window.parent.location.reload();
									varindex = parent.layer.getFrameIndex(window.name);
									parent.layer.close(index);
								});
							} else {
								layer.msg(res.message, {
									offset: '15px',
									icon: 2,
									time: 1000
								});
							}
						}
					})
				}
				layui.use(['layer', 'form'], function() {
					var layer = layui.layer,
						$ = layui.jquery;

						$(".pass").click(function(){
							send_ajax("{:url('offer')}",{id:'{$info.o_id}',s_id:'{$info.id}',status:1})
						});
						$(".reject").click(function(){
							layer.prompt({title: '驳回原因', formType: 2}, function(text, index){
								layer.close(index);
								send_ajax("{:url('offer')}",{id:'{$info.o_id}',s_id:'{$info.id}',status:2,examine_msg:text})
							});
						});
						
				});
			</script>
		</div>
	</body>

</html>
